package doc.ic.walkmore.weka;

import doc.ic.walkmore.toolbox.ToolBox;

public class DataPoint {
	private double x,y,z;
	private long timestamp;
	
	public DataPoint() {
	}
	public DataPoint(double _x, double _y, double _z, long _timestamp){
		x = _x;
		y = _y;
		z = _z;
		timestamp = _timestamp;
	}
	public DataPoint(DataPoint dp){
		x = dp.getX();
		y = dp.getY();
		z = dp.getZ();
		timestamp = dp.getTimestamp();
	}
	public double getX() {
		return x;
	}
	public void setX(double x) {
		this.x = x;
	}
	public double getY() {
		return y;
	}
	public void setY(double y) {
		this.y = y;
	}
	public double getZ() {
		return z;
	}
	public void setZ(double z) {
		this.z = z;
	}
	public long getTimestamp() {
		return timestamp;
	}
	public void setTimestamp(long t) {
		this.timestamp = t;
	}
	@Override
	public String toString() {
		return "Date: " + ToolBox.timestampToStringDate(timestamp,"HH:mm:ss.SSS") + ", x: " + x + ", y: " + y + ", z: " + z;
	}
	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o instanceof DataPoint) {
			DataPoint other = (DataPoint)o;
			if (x != other.x)
				return false;
			if (y != other.y)
				return false;
			if (z != other.z)
				return false;
			if (timestamp != other.timestamp)
				return false;
				
			return true;
		}
		return false;
	}
}
